package com.yuyou.fn.tradingservice.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.educational.entity.Room;
import com.yuyou.fn.platform.entity.SysUser;
import com.yuyou.fn.tradingservice.entity.PersonLeaseMessage;
import com.yuyou.fn.tradingservice.entity.ServiceProduct;
import com.yuyou.fn.tradingservice.vo.PersonLeaseQueryVo;
import com.yuyou.fn.tradingservice.vo.PersonLeaseResultVo;
import com.yuyou.fn.tradingservice.vo.PersonLeaseSearchVo;
import com.yuyou.fn.tradingservice.vo.TimeStampLong;

import java.util.Date;
import java.util.List;

/**
 *
 * PersonLeaseMessage 表数据服务层接口
 *
 */
public interface IPersonLeaseMessageService extends ISuperService<PersonLeaseMessage,Long> {


    List<PersonLeaseMessage> findPersonLeaseMessage(PersonLeaseQueryVo personLeaseQueryVo);

    List<TimeStampLong> findTimeStampLongByPersonLease(PersonLeaseMessage personLeaseMessage);

    List<TimeStampLong> findTimeStampLongBySearch(PersonLeaseSearchVo personLeaseSearchVo);

    PersonLeaseResultVo findPersonLeaseTime(SysUser sysUser,PersonLeaseSearchVo personLeaseSearchVo);

    /*添加租赁时间到清单或者更改租赁状态状态  state=1添加 lease_state为9， state=2更改lease_state为0*/
    List<PersonLeaseMessage> addOrBuyPersonLeaseMessage(Integer check,Integer state,SysUser sysUser, List<PersonLeaseMessage> personLeaseMessageList, ServiceProduct serviceProduct,Long payMainAccountId) ;

    void changeLeaseStateByIds(List<Long> personLeaseIds,Integer leaseState);

    void updatePayIdAndLeaseState(List<Long> personLeaseIds,Integer leaseState,Long payMainAccountId);

    List<PersonLeaseMessage> findByIdsAndDate(List<Long> personLeaseIds, Date date);

    List<PersonLeaseMessage> changeTimeDesc(PersonLeaseMessage personLeaseMessage,List<PersonLeaseMessage> personLeaseMessageList);

    Page<Room> findRoomByBuyOrCreate(Long classId, SysUser sysUser, Long campusId, String roomName, int pageNo, int pageSize);

    void deleteByClassIdAndLeaseState(Long classId,Integer leaseState);

    void deleteByClassIdsAndLeaseState(List<Long> classIdList,Integer leaseState);
}